set more off
* scheme available here: net describe gr0070, from(http://www.stata-journal.com/software/sj17-3)
set scheme plotplain
*set scheme s1mono

*Load data
use "ITA_public_replication_data.dta", clear




***************************************************************************************
                      *ANALYSIS FOR MAIN MANUSCRIPT
***************************************************************************************


************************
 *TABLE 2 ITA DATA*
************************

*Own Mask Use 
summ yourmaskuse_num 
*Others Mask Use
summ othersmaskuse_num
*Masks Protect You in Control Group
summ mskblfs_prtctyou if T_mask_protectyou == 0 & T_mask_protectother == 0
*Masks Protect others in Control Group
summ mskblfs_prtctothers if T_mask_protectyou == 0 & T_mask_protectother == 0

**************************************************
    *FIGURE 1 PANEL B ITALY ANALYSIS AND FIGURE*
**************************************************

*Analysis for Figure 1 Panel B (Table appears in S3 Appendix, columns 5,6,7, and 8)
	foreach var of varlist mskblfs_prtctothers binary_mskblfs_prtctothers mskblfs_prtctyou binary_mskblfs_prtctyou {
		regress `var' T_mask_protectyou T_mask_protectother  lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine, robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
		sum `var' if e(sample)
	}

*Make Figure 1 Panel B
	coefplot mskblfs_prtctothers binary_mskblfs_prtctothers mskblfs_prtctyou binary_mskblfs_prtctyou, keep(T_mask_protectyou T_mask_protectother) levels(95) omitted baselevels xline(0) title("Panel B: Effect of Mask Treatment on Beliefs (Italy)") xtitle("Change in Outcome", size(small)) legend(order(2 "Masks Protect Others" 4 "Masks Protect Others Binary" 6 "Masks Protect You" 8 "Masks Protect You Binary") size(small) on) xlabel(, labels labsize(small)) ylabel(, labels labsize(small)) name(Figure1_PanelB, replace) 
	graph export Figures\Figure1_PanelB.pdf, replace

**************************************************
    *FIGURE 2 PANEL B and Panel D ITALY DATA*
**************************************************

	
*Analysis for Figure 2 Panel B (Table appears in S3 Appendix, columns 5-8 of self outcome analysis)
	foreach var of varlist pool_self pool_self_binary pool_self_alt_bin {
		regress `var' T_mask_protectyou T_mask_protectother pool_self_others pool_self_scenario_atm pool_self_scenario_meet lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine, robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
		sum `var' if e(sample)
	}	

*Make Figure 2 Panel B
	coefplot pool_self pool_self_binary pool_self_alt_bin, keep(T_* pool_self_others) levels(95) omitted baselevels xline(0) title("Panel B: Italy Pooled Scenarios, Own Mask Behavior") legend(order(2 "Pooled Self Action Scale 1-4" 4 "Pooled Self Action Binary" 6 "Pooled Self Action Alt. coding Binary (leave or mask)") size(vsmall) on) xtitle("Change in Outcome", size(small)) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) name(Figure2_PanelB, replace) 
	
	graph export Figures\Figure2_PanelB.pdf, replace
	

*Analysis for Figure 2 Panel D (Table appears in S3 appendix, columns 3 & 4 of other outcome analysis)	
	foreach var of varlist pool_other pool_other_binary {
		regress `var' T_mask_protectyou T_mask_protectother pool_other_others pool_other_scenario_atm pool_other_scenario_meet lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine, robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
		sum `var' if e(sample)
	}


*Make Figure 2 Panel D
	coefplot pool_other pool_other_binary, keep(T_* pool_other_others) levels(95) omitted baselevels xline(0) title("Panel D: Italy Pooled Scenarios, Action Toward Other") legend(order(2 "Pooled other Action Scale 1-4" 4 "Pooled other Action Binary") size(vsmall) on) xtitle("Change in Outcome", size(small)) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) name(Figure2_PanelD, replace) 
	
	graph export Figures\Figure2_PanelD.pdf, replace

	
	
**************************************************
    *FIGURE 3 PANEL B and Panel D ITALY DATA*
**************************************************	

*Analysis for Figure 3 Panel B (Table appears in S3 appendix column 3 of third party analysis)
	regress pool_3Pnegjudge T_mask_protectyou T_mask_protectother pool_3Pothers pool_3P_atm pool_3P_meet lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine, robust
	est store pool_3Pnegjudge
	lincom T_mask_protectyou-T_mask_protectother
	sum pool_3Pnegjudge if e(sample)
	
*Make Figure 3 Panel B
	coefplot pool_3Pnegjudge, keep(T_mask_protectyou T_mask_protectother pool_3Pothers) levels(95) omitted baselevels xline(0) title("Panel B: Italy Pooled Scenarios" "3rd Party Judgment of Person Wearing Mask Incorrectly", size(small)) legend(order(2 "Negative Judgment Scale") size(vsmall) on) xtitle("Change in Outcome", size(small)) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) xsize(7) name(Figure3_PanelB, replace) 
	graph export figures\Figure3_PanelB.pdf, replace

*Analysis for Figure 3 Panel D (Table appears in S3 appendix column 4 of third party analysis)
	regress pool_3Pactionnegjudge T_mask_protectyou T_mask_protectother pool_3Pothers pool_3P_atm pool_3P_meet lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine if pool_3P_askfixmask==1, robust
	est store pool_3Pnegjudge_fix
	lincom T_mask_protectyou-T_mask_protectother
	sum pool_3Pactionnegjudge if e(sample)

*Make Figure 3 Panel D
	coefplot pool_3Pnegjudge_fix, keep(T_mask_protectyou T_mask_protectother pool_3Pothers) levels(95) omitted baselevels xline(0) title("Panel D: Italy Pooled Scenarios" "3rd Party Judgment of Person Who Asked to Fix Mask", size(small)) legend(order(2 "Negative Judgment Scale") size(vsmall) on) xtitle("Change in Outcome", size(small)) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) xsize(7) name(Figure3_PanelD, replace) 
	graph export figures\Figure3_PanelD.pdf, replace
	
	
**********************************************************************************************************
                                      *END ANALYSIS FOR MAIN MANUSCRIPT*
**********************************************************************************************************


**********************************************************************************************************
                                      *START ANALYSIS FOR S4 Appendix*
**********************************************************************************************************
	
*Analysis for first S4 Appendix Figure that subsets data to examining respondents who saw the Self scenario first
	foreach var of varlist pool_self pool_self_binary pool_self_alt_bin {
		regress `var' T_mask_protectyou T_mask_protectother pool_self_others pool_self_scenario_atm pool_self_scenario_meet lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine if (FirstScenario == 1 & atmtreatment ==0)|(FirstScenario == 2 & parktreatment == 0)|(FirstScenario == 3 & meetingtreatment == 0), robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
	}

*Make Italy side of first S4 Appendix Figure
	coefplot pool_self pool_self_binary pool_self_alt_bin, keep(T_* pool_self_others) levels(95) omitted baselevels xline(0) title("Pooled Scenarios: Own Mask Behavior", size(small)) legend(order(2 "Pooled Self Action Scale 1-4" 4 "Pooled Self Action Binary" 6 "Pooled Self Action Alt. coding Binary (leave or mask)") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) name(pool_self_first, replace) 
	graph export figures\Italy\Pooled_Self_First.pdf, replace


*Analysis for second S4 Appendix Figure that subsets data to examining respondents who saw the Other scenario first
	foreach var of varlist pool_other pool_other_binary {
		regress `var' T_mask_protectyou T_mask_protectother pool_other_others pool_other_scenario_atm pool_other_scenario_meet lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine if (FirstScenario == 1 & atmtreatment ==1)|(FirstScenario == 2 & parktreatment == 1)|(FirstScenario == 3 & meetingtreatment == 1), robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
	}

*Make Italy side of second S4 Appendix Figure
	coefplot pool_other pool_other_binary, keep(T_* pool_other_others) levels(95) omitted baselevels xline(0) title("Pooled Scenarios: Action toward other", size(small)) legend(order(2 "Pooled other Action Scale 1-4" 4 "Pooled other Action Binary") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) name(pool_other_first, replace) 
	graph export figures\Italy\Pooled_Other_First.pdf, replace

**********************************************************************************************************
                                      *END ANALYSIS FOR S4 Appendix*
**********************************************************************************************************


**********************************************************************************************************
                                      *START ANALYSIS FOR S5 Appendix*
**********************************************************************************************************


****Start with ATM Scenarios****
* S5 Appendix ATM Scenario Self and Other Analysis
	foreach var of varlist atmself atmself_binary atmother atmother_binary {
		regress `var' T_mask_protectyou T_mask_protectother T_atm_othersinline lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine, robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
	}

*ATM Self figure
	coefplot atmself atmself_binary, keep(T_*) levels(95) omitted baselevels xline(0) title("ATM Scenario: Own Mask Behavior", size(small)) legend(order(2 "ATM Self Action Scale 1-4" 4 "ATM Self Action Binary") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) name(atm_self, replace) 
	graph export figures\Italy\ATM_Self.pdf, replace

*ATM Other figure
	coefplot atmother atmother_binary, keep(T_*) levels(95) omitted baselevels xline(0) title("ATM Scenario: Action toward other", size(small)) legend(order(2 "ATM Other Action Scale 1-4" 4 "ATM Other Action Binary") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) name(atm_other, replace) 
	graph export figures\Italy\ATM_Other.pdf, replace

*ATM Third Party Judgment for Not Wearing a Mask and also Reckless Item Analysis
	foreach var of varlist atm3P_negjudgescale atm3P_notmask_rckls {
		regress `var' T_mask_protectyou T_mask_protectother T_atm_others lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine, robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
	}

*ATM Third Party Judgment and Reckless Figure
	coefplot atm3P_negjudgescale atm3P_notmask_rckls, keep(T_*) levels(95) omitted baselevels xline(0) title("ATM Scenario: 3rd Party Behavior (Judge person not wearing mask correctly)", size(small)) legend(order(2 "Negative Judgment Scale" 4 "Person Reckless") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) xsize(7) name(atm_3pnomask, replace) 
	graph export figures\Italy\atm_3pnomask.pdf, replace

* ATM Person Asked to Fix Mask Analysis 
	foreach var of varlist atm3P_actionnegjudge atm3P_action_agrsv atm3P_action_rckls {
		regress `var'  T_mask_protectyou T_mask_protectother T_atm_others lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine if T_thirdpartyatmaction==4, robust
		est store `var'_fix
		lincom T_mask_protectyou-T_mask_protectother
	}

*ATM Person Asked to Fix Mask Figure
	coefplot atm3P_actionnegjudge_fix atm3P_action_agrsv_fix atm3P_action_rckls_fix, keep(T_*) levels(95) omitted baselevels xline(0) title("ATM Scenario: 3rd Party Behavior (Judge person asking person to fix mask)", size(small)) legend(order(2 "Negative Judgment Scale" 4 "Person Aggressive" 6 "Person Reckless") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) xsize(7) name(atm_3p_askmask, replace) 
	graph export figures\Italy\atm_3p_askmask.pdf, replace
	
****Park Scenarios****

* S5 Appendix PARK Scenario Self and Other Analysis
	foreach var of varlist parkself parkself_binary parkother parkother_binary {
		regress `var' T_mask_protectyou T_mask_protectother T_park_othersatpark lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine, robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
	}

*PARK Self figure
	coefplot parkself parkself_binary, keep(T_*) levels(95) omitted baselevels xline(0) title("Park Scenario: Own Mask Behavior", size(small)) legend(order(2 "Park Self Action Scale 1-4" 4 "Park Self Action Binary") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) name(park_self, replace) 
	graph export figures\Italy\Park_Self.pdf, replace

*PARK Other figure	
	coefplot parkother parkother_binary, keep(T_*) levels(95) omitted baselevels xline(0) title("Park Scenario: Action toward other", size(small)) legend(order(2 "Park Other Action Scale 1-4" 4 "Park Other Action Binary") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) name(park_other, replace) 
	graph export figures\Italy\Park_Other.pdf, replace

*PARK Third Party Judgment for Not Wearing a Mask and also Reckless Item Analysis
	foreach var of varlist park3P_negjudgescale park3P_notmask_rckls {
		regress `var'  T_mask_protectyou T_mask_protectother T_park_others lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine, robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
	}

*PARK Third Party Judgment and Reckless Figure
	coefplot park3P_negjudgescale park3P_notmask_rckls, keep(T_*) levels(95) omitted baselevels xline(0) title("PARK Scenario: 3rd Party Behavior (Judge person not wearing mask correctly)", size(small)) legend(order(2 "Negative Judgment Scale" 4 "Person Reckless") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) xsize(7) name(park_3pnomask, replace) 
	graph export figures\Italy\park_3pnomask.pdf, replace

*PARK Person Asked to Fix Mask Analysis
	foreach var of varlist park3P_actionnegjudge park3P_action_agrsv park3P_action_rckls {
		regress `var' T_mask_protectyou T_mask_protectother T_park_others lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine if T_thirdpartyparkaction==4, robust
		est store `var'_fix
		lincom T_mask_protectyou-T_mask_protectother
	}

*PARK Person Asked to Fix Mask Figure
	coefplot park3P_actionnegjudge_fix park3P_action_agrsv_fix park3P_action_rckls_fix, keep(T_*) levels(95) omitted baselevels xline(0) title("PARK Scenario: 3rd Party Behavior (Judge person asking person to fix mask)", size(small)) legend(order(2 "Negative Judgment Scale" 4 "Person Aggressive" 6 "Person Reckless") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) xsize(7) name(park_3p_askmask, replace) 
	graph export figures\Italy\park_3p_askmask.pdf, replace

****MEET Scenarios****

* S5 Appendix MEET Scenario Self and Other Analysis
	foreach var of varlist meetself meetself_binary meetother meetother_binary {
		regress `var' T_mask_protectyou T_mask_protectother T_meet_othersatmeet lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine, robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
	}

*MEET Self figure
	coefplot meetself meetself_binary, keep(T_*) levels(95) omitted baselevels xline(0) title("Meeting Scenario: Own Mask Behavior", size(small)) legend(order(2 "Meet Self Action Scale 1-4" 4 "Meet Self Action Binary") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) name(meet_self, replace) 
	graph export figures\Italy\Meeting_Self.pdf, replace

*MEET Other figure
	coefplot meetother meetother_binary, keep(T_*) levels(95) omitted baselevels xline(0) title("Meeting Scenario: Action toward other", size(small)) legend(order(2 "Meet Other Action Scale 1-4" 4 "Meet Other Action Binary") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) name(meet_other, replace) 
	graph export figures\Italy\Meeting_Other.pdf, replace

*MEET Third Party Judgment for Not Wearing a Mask and also Reckless Item Analysis
	foreach var of varlist meet3P_negjudgescale meet3P_notmask_rckls {
		regress `var'  T_mask_protectyou T_mask_protectother T_meet_others lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine, robust
		est store `var'
		lincom T_mask_protectyou-T_mask_protectother
	}

*MEET Third Party Judgment and Reckless Figure
	coefplot meet3P_negjudgescale meet3P_notmask_rckls, keep(T_*) levels(95) omitted baselevels xline(0) title("Meeting Scenario: 3rd Party Behavior (Judge person not wearing mask correctly)", size(small)) legend(order(2 "Negative Judgment Scale" 4 "Person Reckless") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) xsize(7) name(meet_3pnomask, replace) 
	graph export figures\Italy\meet_3pnomask.pdf, replace

*MEET Person Asked to Fix Mask Analysis
	foreach var of varlist meet3P_actionnegjudge meet3P_action_agrsv meet3P_action_rckls {
		regress `var'  T_mask_protectyou T_mask_protectother T_meet_others lucid_age i.female lucid_hhi lucid_incmissing education ib0.voto i.workstatus c.fluvaccine if T_thirdpartymeetaction==4, robust
		est store `var'_fix
		lincom T_mask_protectyou-T_mask_protectother
	}

*MEET Person Asked to Fix Mask Figure
	coefplot meet3P_actionnegjudge_fix meet3P_action_agrsv_fix meet3P_action_rckls_fix, keep(T_*) levels(95) omitted baselevels xline(0) title("Meeting Scenario: 3rd Party Behavior (Judge person asking person to fix mask)", size(small)) legend(order(2 "Negative Judgment Scale" 4 "Person Aggressive" 6 "Person Reckless") size(vsmall) on) note(Omitted masks treatment category is control) xlabel(, labels labsize(vsmall)) ylabel(, labels labsize(small)) xsize(7) name(meet_3p_askmask, replace) 
	graph export figures\Italy\meet_3p_askmask.pdf, replace
		
**********************************************************************************************************
                                      *END ANALYSIS FOR S5 Appendix*
**********************************************************************************************************
